<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords" content="多谱音乐，音乐，曲谱播放器，五线谱，吉他谱，六线谱，简谱，四线谱，钢琴谱，小提琴谱，二胡谱，手风琴谱，扒谱，谱单，收藏，分享音乐，音乐互动，音乐社交，官网，dscore.cn">
    <meta name="description" content="多谱音乐是一款专注于发现与分享乐谱和音乐的产品，依托专业音乐人、DJ、好友推荐及社交功能，为用户打造全新的音乐生活。">

    <title>多谱音乐  --  中国最全最好用的音乐钢琴谱吉他谱尤克里里谱平台</title>
    <link rel="stylesheet" href="__STATIC__/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="__CSS__/common.css">
    <link rel="icon" href="__PUBLIC__/favicon.ico">
    <!--[if lt IE 9]>
    <script type="text/javascript" src="__STATIC__/jquery-1.10.2.min.js"></script>
    <![endif]--><!--[if gte IE 9]><!-->
    <script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
</head>
<body>
    <div class="collect-sheet">
        <a href="{:U('score/addScore', 'id='.$sheet_id)}" class="color-black">
            <div class="add-score">
            <i class="glyphicon glyphicon-plus-sign"></i>
            添加新谱单
            </div>
        </a>
        <div class="user-score-list">
            <ul class="padding-0">
                <volist name="scores" id="score">
                    <li class="score" data-id="{$score.id}">
                        <div class="item">
                            <div class="left">
                                <img src="{$score.img_url}">
                            </div>
                            <p class="name">{$score.name}</p>
                            <p class="count">{$score.sheet_count}首</p>
                        </div>
                    </li>
                </volist>
                <input class="sheet-id" hidden value="{$sheet_id}">
            </ul>
        </div>
    </div>
    <script type="text/javascript" src="__JS__/layer.js"></script>
    <script>
        $('.score').on("click", function () {
            var sheet_id = $('.sheet-id').val();
            var score_id = $(this).attr('data-id');
            var data = {"sheet_id":sheet_id, "score_id":score_id};
            console.log(data);
            var url = "{:U('sheet/collectSheet')}";
            $.post(url, data, function (result) {
                if (result.code == 200) {
                    layer.msg(result.msg, {
                        icon: 1,
                        time: 1500
                    }, function () {
                        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                        parent.layer.close(index); //再执行关闭
                    });
                } else {
                    layer.msg(result.msg, {
                        icon: 2,
                        time: 1500
                    }, function () {
                        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                        parent.layer.close(index); //再执行关闭
                    });
                }
            });
        });
    </script>
</body>
</html>